package com.ft.turorial.spring.boot.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import com.ft.turorial.spring.boot.domain.User;

/**
 * Mapper接口的sql语句可以通过在方法上增加注解，也可以将sql语句配置在 mapper.xml文件中
 * 
 * Mapper接口的扫描，可以在接口类上增加@Mapper，也可以在启动类上增加@MapperScan
 * @author ft
 *
 */
@Mapper
public interface UserMapper {
	
	User insertSelective(User user);
	User insert(User user);
	@Select("select * from user where id= #{id,jdbcType=INTEGER} ")
	User findOne(int id);
	List<User> findAll();
	User findLikeName(String name);
	
	int deleteByPrimaryKey(int id);
	
	int updateByPrimaryKeySelective(User user);
	int updateByPrimaryKey(User user);
	
}
